home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / MacLookAndFeel.java < prev    next >
Text File  |  1998-06-30  |  51KB  |  882 lines

  1. /*
  2.  * @(#)MacLookAndFeel.java    1.16 98/04/10
  3.  *
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  *
  19.  */
  20.  
  21.  
  22. package com.sun.java.swing.plaf.mac;
  23.  
  24.  
  25. import java.awt.Color;
  26. import java.awt.Font;
  27. import java.net.URL;
  28. import java.io.*;
  29.  
  30.  
  31. import com.sun.java.swing.*;
  32. import com.sun.java.swing.plaf.*;
  33. import com.sun.java.swing.border.*;
  34.  
  35. import com.sun.java.swing.plaf.basic.BasicLookAndFeel;
  36. import com.sun.java.swing.plaf.basic.BasicMarginBorder;
  37. import com.sun.java.swing.plaf.basic.BasicComboBoxRenderer;
  38. import com.sun.java.swing.plaf.basic.BasicComboBoxEditor;
  39.  
  40. /**
  41.  * The base class for the Mac Look and Feel.
  42.  * <p>
  43.  * For the keyboard keys defined for each component in this Look and
  44.  * Feel (L&F), see 
  45.  * <a href="../../doc-files/Key-Mac.html">Component Keystroke Actions for the Mac L&F</a>.
  46.  * <b>Note:</b> The link above is only a placeholder. It will not be valid
  47.  *              until this L&F is released.
  48.  * <p>
  49.  * Warning: serialized objects of this class will not be compatible with
  50.  * future swing releases.  The current serialization support is appropriate
  51.  * for short term storage or RMI between Swing1.0 applications.  It will
  52.  * not be possible to load serialized Swing1.0 objects with future releases
  53.  * of Swing.  The JDK1.2 release of Swing will be the compatibility
  54.  * baseline for the serialized form of Swing objects.
  55.  *
  56.  * @version 1.16 04/10/98
  57.  * @author Symantec
  58.  */
  59.  
  60. public class MacLookAndFeel extends BasicLookAndFeel 
  61. {
  62.     public String getName() {
  63.                 return "Macintosh";
  64.     }
  65.  
  66.  
  67.         public String getID() {
  68.                 return "Macintosh";
  69.     }
  70.  
  71.  
  72.     public String getDescription() {
  73.                 return "The Macintosh Look and Feel";
  74.     }
  75.  
  76.  
  77.     public boolean isNativeLookAndFeel() {
  78.         return MacUtilities.IsMacOS();
  79.     }
  80.  
  81.  
  82.     public boolean isSupportedLookAndFeel() {
  83.     return isNativeLookAndFeel();
  84.     }
  85.  
  86.  
  87.     /**
  88.      * Load the SystemColors into the defaults table.
  89.      * Included is the ramp from the Grayscale Appearance
  90.      * Specification
  91.      */
  92.     protected void initSystemColorDefaults(UIDefaults table)
  93.     {
  94.                 Object[] grayscaleAppearanceColors =
  95.                 {
  96.                         "GrayscaleAppearanceB",         MacUtilities.GrayscaleAppearanceB,      /* Grayscale Appearance Color B */
  97.                         "GrayscaleAppearanceW",         MacUtilities.GrayscaleAppearanceW,      /* Grayscale Appearance Color W */
  98.                         "GrayscaleAppearance1",         MacUtilities.GrayscaleAppearance1,      /* Grayscale Appearance Color 1 */
  99.                         "GrayscaleAppearance2",         MacUtilities.GrayscaleAppearance2,      /* Grayscale Appearance Color 2 */
  100.                         "GrayscaleAppearance3",         MacUtilities.GrayscaleAppearance3,      /* Grayscale Appearance Color 3 */
  101.                         "GrayscaleAppearance4",         MacUtilities.GrayscaleAppearance4,      /* Grayscale Appearance Color 4 */
  102.                         "GrayscaleAppearance5",         MacUtilities.GrayscaleAppearance5,      /* Grayscale Appearance Color 5 */
  103.                         "GrayscaleAppearance6",         MacUtilities.GrayscaleAppearance6,      /* Grayscale Appearance Color 6 */
  104.                         "GrayscaleAppearance7",         MacUtilities.GrayscaleAppearance7,      /* Grayscale Appearance Color 7 */
  105.                         "GrayscaleAppearance8",         MacUtilities.GrayscaleAppearance8,      /* Grayscale Appearance Color 8 */
  106.                         "GrayscaleAppearance9",         MacUtilities.GrayscaleAppearance9,      /* Grayscale Appearance Color 9 */
  107.                         "GrayscaleAppearance10",        MacUtilities.GrayscaleAppearance10,     /* Grayscale Appearance Color 10 */
  108.                         "GrayscaleAppearance11",        MacUtilities.GrayscaleAppearance11,     /* Grayscale Appearance Color 11 */
  109.                         "GrayscaleAppearance12",        MacUtilities.GrayscaleAppearance12,     /* Grayscale Appearance Color 12 */
  110.                         "GrayscaleAppearanceA1",        MacUtilities.GrayscaleAppearanceA1,     /* Grayscale Appearance Color A1 */
  111.                         "GrayscaleAppearanceA2",        MacUtilities.GrayscaleAppearanceA2,     /* Grayscale Appearance Color A2 */
  112.  
  113. /*****************************************************
  114.  *
  115.  *                      Use these colors when an accent (tinged) version of the grayscale color is desired.
  116.  *                      These entries are set in AppearanceFilter.setAppearance().
  117.  *
  118.  *                      "AccentAppearance1",            AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance1),
  119.  *                      "AccentAppearance2",            AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance2),
  120.  *                      "AccentAppearance3",            AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance3),
  121.  *                      "AccentAppearance4",            AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance4),
  122.  *                      "AccentAppearance5",            AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance5),
  123.  *                      "AccentAppearance6",            AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance6),
  124.  *                      "AccentAppearance7",            AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance7),
  125.  *                      "AccentAppearance8",            AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance8),
  126.  *                      "AccentAppearance9",            AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance9),
  127.  *                      "AccentAppearance10",           AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance10),
  128.  *                      "AccentAppearance11",           AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance11),
  129.  *                      "AccentAppearance12",           AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance12),
  130.  *                      "AccentAppearanceA1",           AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearanceA1),
  131.  *                      "AccentAppearanceA2",           AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearanceA2),
  132.  ******************************************************/
  133.                 };
  134.  
  135.                 for(int i = 0; i < grayscaleAppearanceColors.length; i += 2)
  136.                 {
  137.                     table.put((String)grayscaleAppearanceColors[i], grayscaleAppearanceColors[i + 1]);
  138.                 }
  139.  
  140.                 
  141.                 
  142.                 // textHighlight is correct in SystemColor.
  143.                 ColorUIResource textHighlight;
  144.                 try {
  145.                         textHighlight = new ColorUIResource((Color)(java.awt.SystemColor.class.getField("textHighlight").get(null)));
  146.                 } catch (Exception e) { 
  147.                         textHighlight = null;
  148.                 }
  149.  
  150.  
  151.                 Object[] defaultSystemColors =
  152.                 {
  153.                 "desktop", "#005C5C",   MacUtilities.GrayscaleAppearance4,      /* Color of the desktop background */
  154.           "activeCaption", "#000080",   MacUtilities.GrayscaleAppearance3,      /* Color for captions (title bars) when they are active. */
  155.       "activeCaptionText", "#000000",                           null,                                   /* Text color for text in captions (title bars). */
  156.     "activeCaptionBorder", "#CCCCCC",   MacUtilities.GrayscaleAppearance3,      /* Border color for caption (title bar) window borders. */
  157.         "inactiveCaption", "#DDDDDD",   MacUtilities.GrayscaleAppearance2,      /* Color for captions (title bars) when not active. */
  158.     "inactiveCaptionText", "#888888",   MacUtilities.GrayscaleAppearance7,      /* Text color for text in inactive captions (title bars). */
  159.   "inactiveCaptionBorder", "#DDDDDD",   MacUtilities.GrayscaleAppearance2,      /* Border color for inactive caption (title bar) window borders. */
  160.                  "window", "#FFFFFF",   MacUtilities.GrayscaleAppearance2,      /* Default color for the interior of windows */
  161.            "windowBorder", "#DDDDDD",   MacUtilities.GrayscaleAppearance2,      /* ??? */
  162.              "windowText", "#000000",                           null,                                   /* ??? */
  163.                    "menu", "#DDDDDD",   MacUtilities.GrayscaleAppearance2,      /* Background color for menus */
  164.                "menuText", "#000000",                           null,                                   /* Text color for menus  */
  165.                    "text", "#C0C0C0",                           null,                                   /* Text background color */
  166.                "textText", "#000000",                           null,                                   /* Text foreground color */
  167.           "textHighlight", "#000000",                   textHighlight,                          /* Text background color when selected */
  168.       "textHighlightText", "#C0C0C0",   MacUtilities.GrayscaleAppearanceB,      /* Text color when selected */
  169.        "textInactiveText", "#808080",                           null,                                   /* Text color when disabled */
  170.                 "control", "#C0C0C0",   MacUtilities.GrayscaleAppearance2,      /* Default color for controls (buttons, sliders, etc) */
  171.             "controlText", "#000000",                           null,                                   /* Default color for text in controls */
  172.        "controlHighlight", "#FFFFFF",                           null,                                   /* Specular highlight (opposite of the shadow) */
  173.      "controlLtHighlight", "#E0E0E0",                           null,                                   /* Highlight color for controls */
  174.           "controlShadow", "#808080",                           null,                                   /* Shadow color for controls */
  175.         "controlDkShadow", "#000000",                           null,                                   /* Dark shadow color for controls */
  176.               "scrollbar", "#DDDDDD",   MacUtilities.GrayscaleAppearance2,      /* Scrollbar background (usually the "track") */
  177.                    "info", "#FFFFCC",                           null,                                   
  178.                "infoText", "#000000",                           null,                                   
  179.      "controlLightShadow", "#9397A5",                           null,                                   /* Shadow color for controls */  
  180.                 };
  181.  
  182.                 loadSystemColors(table, defaultSystemColors);
  183.     }
  184.  
  185.  
  186.  
  187.     /**
  188.      * If this is the native look and feel the initial values for the
  189.      * system color properties are the same as the SystemColor constants.
  190.      * If not we use the integer color values in the <code>systemColors</code>
  191.      * argument.
  192.      */
  193.     protected void loadSystemColors(UIDefaults table, Object[] systemColors)
  194.     {
  195.                 if (false && isNativeLookAndFeel()) {
  196.                         for(int i = 0; i < systemColors.length; i += 3) {
  197.                                 Color color = Color.black;
  198.                                 try {
  199.                                         String name = (String) systemColors[i];
  200.                                         color = (Color)(java.awt.SystemColor.class.getField(name).get(null));
  201.                                 } catch (Exception e) { 
  202.                                 }
  203.                                 table.put((String) systemColors[i], new ColorUIResource(color));
  204.                         }
  205.                 } else {
  206.                         for(int i = 0; i < systemColors.length; i += 3) {
  207.                                 if (systemColors[i + 2] != null)
  208.                                 {
  209.                                         table.put((String) systemColors[i], (ColorUIResource) systemColors[i + 2]);
  210.                                 }
  211.                                 else
  212.                                 {
  213.                                         Color color = Color.black;
  214.                                         try {
  215.                                                 color = Color.decode((String) systemColors[i + 1]);
  216.                                         } 
  217.                                         catch(NumberFormatException e) {
  218.                                                 e.printStackTrace();
  219.                                         }
  220.                                         table.put((String) systemColors[i], new ColorUIResource(color));
  221.                                 }
  222.                         }
  223.                 }
  224.         }
  225.  
  226.     protected void initClassDefaults(UIDefaults table)
  227.     {
  228.         super.initClassDefaults(table);
  229.  
  230.         String macPackageName = "com.sun.java.swing.plaf.mac.";
  231.         Object[] uiDefaults = {
  232.                 "ButtonUI", macPackageName + "MacButtonUI",
  233.               "CheckBoxUI", macPackageName + "MacCheckBoxUI",
  234.                  "LabelUI", macPackageName + "MacLabelUI",
  235.                   "ListUI", macPackageName + "MacListUI",
  236.                "MenuBarUI", macPackageName + "MacMenuBarUI",
  237.                   "MenuUI", macPackageName + "MacMenuUI",
  238.               "MenuItemUI", macPackageName + "MacMenuItemUI",
  239.       "CheckBoxMenuItemUI", macPackageName + "MacCheckBoxMenuItemUI",
  240.    "RadioButtonMenuItemUI", macPackageName + "MacRadioButtonMenuItemUI",
  241.            "RadioButtonUI", macPackageName + "MacRadioButtonUI",
  242.           "ToggleButtonUI", macPackageName + "MacToggleButtonUI",
  243.              "PopupMenuUI", macPackageName + "MacPopupMenuUI",
  244.            "ProgressBarUI", macPackageName + "MacProgressBarUI",
  245.              "ScrollBarUI", macPackageName + "MacScrollBarUI",
  246.                 "SliderUI", macPackageName + "MacSliderUI",
  247.                "SpinnerUI", macPackageName + "MacSpinnerUI",
  248.              "SplitPaneUI", macPackageName + "MacSplitPaneUI",
  249.             "TabbedPaneUI", macPackageName + "MacTabbedPaneUI",
  250.                  "TableUI", macPackageName + "MacTableUI",
  251.            "TableHeaderUI", macPackageName + "MacTableHeaderUI",
  252.               "TextAreaUI", macPackageName + "MacTextAreaUI",
  253.              "TextFieldUI", macPackageName + "MacTextFieldUI",
  254.          "PasswordFieldUI", macPackageName + "MacPasswordFieldUI",
  255.               "TextPaneUI", macPackageName + "MacTextPaneUI",
  256.             "EditorPaneUI", macPackageName + "MacEditorPaneUI",
  257.                   "TreeUI", macPackageName + "MacTreeUI",
  258.          "InternalFrameUI", macPackageName + "MacInternalFrameUI",
  259.            "DesktopPaneUI", macPackageName + "MacDesktopPaneUI",
  260.              "SeparatorUI", macPackageName + "MacSeparatorUI",
  261.             "OptionPaneUI", macPackageName + "MacOptionPaneUI",
  262.               "ComboBoxUI", macPackageName + "MacComboBoxUI",
  263.       "ComboBoxMenuItemUI", macPackageName + "MacComboBoxMenuItemUI",
  264.            "DesktopIconUI", macPackageName + "MacDesktopIconUI",
  265.                "ToolTipUI", macPackageName + "MacToolTipUI",
  266.         };
  267.  
  268.         table.putDefaults(uiDefaults);
  269.     }
  270.  
  271.  
  272.         /**
  273.          * Utility method that creates a UIDefaults.ActiveValue that creates
  274.          * an colorized grayscale Color UIResource for the specified <code>accent</code>
  275.          * color.
  276.          */
  277.         private final Object makeAccentColor(final String accent)
  278.         {
  279.                 return new UIDefaults.ActiveValue() {
  280.                         public Object createValue(UIDefaults table) {
  281.                                 return table.get(accent);
  282.                         }
  283.                 };
  284.         }
  285.  
  286.     /**
  287.      * Utility method that creates a UIDefaults.LazyValue that creates
  288.      * an ImageIcon UIResource for the specified <code>gifFile</code>
  289.      * filename.
  290.      */
  291.     private final Object makeIcon(final String gifFile)
  292.     {
  293.         return LookAndFeel.makeIcon(getClass(), gifFile);
  294.     }
  295.  
  296.     /**
  297.      * Utility method that creates a UIDefaults.LazyValue that creates
  298.      * an ImageIcon (Not a UIResource) for the specified <code>gifFile</code>
  299.      * filename.
  300.      */
  301.     private static Object makeImageIcon(final String gifFile)
  302.     {
  303.                 return new UIDefaults.LazyValue()
  304.                 {
  305.                         public Object createValue(UIDefaults table)
  306.                         {
  307.                                 byte[] buffer = null;
  308.                                 try
  309.                                 {
  310.                                         /* Copy resource into a byte array.  This is
  311.                                         * necessary because several browsers consider
  312.                                         * Class.getResource a security risk because it
  313.                                         * can be used to load additional classes.
  314.                                         * Class.getResourceAsStream just returns raw
  315.                                         * bytes, which we can convert to an image.
  316.                                         */
  317.                                         InputStream resource = getClass().getResourceAsStream(gifFile);
  318.                                         if (resource == null)
  319.                                         {
  320.                                                 System.err.println(getClass().getName() + "/" + 
  321.                                                 gifFile + " not found.");
  322.                                                 return null; 
  323.                                         }
  324.                                         BufferedInputStream in = new BufferedInputStream(resource);
  325.                                         ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
  326.                                         buffer = new byte[1024];
  327.                                         int n;
  328.                                         while ((n = in.read(buffer)) > 0)
  329.                                         {
  330.                                                 out.write(buffer, 0, n);
  331.                                         }
  332.                                         in.close();
  333.                                         out.flush();
  334.                                         
  335.                                         buffer = out.toByteArray();
  336.                                         if (buffer.length == 0)
  337.                                         {
  338.                                                 System.err.println("warning: " + gifFile + " is zero-length");
  339.                                                 return null;
  340.                                         }
  341.                                 }
  342.                                 catch (IOException ioe)
  343.                                 {
  344.                                         System.err.println(ioe.toString());
  345.                                         return null;
  346.                                 }                               
  347.                                 return new ImageIcon(buffer);
  348.                         }
  349.                 };
  350.     }
  351.  
  352.  
  353.     protected void initComponentDefaults(UIDefaults table)
  354.     {
  355.         super.initComponentDefaults(table);
  356.         
  357.         AppearanceFilter.setAppearance(getCurrentAppearance(), table);
  358.  
  359.         FontUIResource dialogPlain12 = new FontUIResource("Dialog", 
  360.                                                           Font.PLAIN, 12);
  361.         FontUIResource serifPlain12 = new FontUIResource("Serif", 
  362.                                                           Font.PLAIN, 12);
  363.         FontUIResource sansSerifPlain9 = new FontUIResource("SansSerif", 
  364.                                                           Font.PLAIN, 9);
  365.         FontUIResource sansSerifPlain10 = new FontUIResource("SansSerif", 
  366.                                                           Font.PLAIN, 10);
  367.         FontUIResource sansSerifPlain12 = new FontUIResource("SansSerif", 
  368.                                                           Font.PLAIN, 12);
  369.         FontUIResource monospacedPlain12 = new FontUIResource("Monospaced", 
  370.                                                           Font.PLAIN, 12);
  371.         ColorUIResource black = new ColorUIResource(Color.black);
  372.         ColorUIResource white = new ColorUIResource(Color.white);
  373.         ColorUIResource controlDarker = new ColorUIResource(147, 151, 165);  // slate blue
  374.  
  375.         Object loweredBevelBorder = new UIDefaults.LazyValue() {
  376.             public Object createValue(UIDefaults table) {
  377.                 return MacBorderFactory.getLoweredBevelBorder();
  378.             }
  379.         };
  380.  
  381.         Object raisedBevelBorder = new UIDefaults.LazyValue() {
  382.             public Object createValue(UIDefaults table) {
  383.                 return MacBorderFactory.getRaisedBevelBorder();
  384.             }
  385.         };
  386.  
  387.         Object buttonBorder = new UIDefaults.LazyValue() {
  388.             public Object createValue(UIDefaults table) {
  389.                 return new BorderUIResource(new CompoundBorder(
  390.                                                         MacBorderFactory.getButtonBorder(),
  391.                                                         BasicMarginBorder.getMarginBorder()));
  392.             }
  393.         }; 
  394.         
  395.         Object textBorder = new UIDefaults.LazyValue() {
  396.             public Object createValue(UIDefaults table) {
  397.                 return new CompoundBorder(
  398.                     MacBorderFactory.getTextBorder(),
  399.                     BasicMarginBorder.getMarginBorder());
  400.             }
  401.         };
  402.         
  403.         Object buttonToggleBorder = new UIDefaults.LazyValue() {
  404.             public Object createValue(UIDefaults table) {
  405.                 return new CompoundBorder(
  406.                     MacBorderFactory.getToggleButtonBorder(),
  407.                     BasicMarginBorder.getMarginBorder());
  408.             }
  409.         };
  410.  
  411.         Object fieldTextBorder = new UIDefaults.LazyValue() {
  412.             public Object createValue(UIDefaults table) {
  413.                 return MacBorderFactory.getFieldBorder();
  414.             }
  415.         };
  416.  
  417.  
  418.         Object multilineTextBorder = new UIDefaults.LazyValue() {
  419.             public Object createValue(UIDefaults table) {
  420.                 return MacBorderFactory.getTextBorder();
  421.             }
  422.         };
  423.  
  424.     Object comboBoxEditorActiveValue  = new UIDefaults.ActiveValue() {
  425.         public Object createValue(UIDefaults table) {
  426.             return new MacComboBoxEditor.UIResource();
  427.         }
  428.     };
  429.  
  430.         Object menuBarBorder = new UIDefaults.LazyValue(){
  431.                 public Object createValue(UIDefaults table) {
  432.                 return MacBorderFactory.getMenuBarBorder();
  433.             }
  434.         };
  435.  
  436.         Object popupMenuBorder = new UIDefaults.LazyValue(){
  437.                 public Object createValue(UIDefaults table) {
  438.                 return MacBorderFactory.getPopupMenuBorder();
  439.             }
  440.         };
  441.  
  442.         Object menuArrowIcon = new UIDefaults.LazyValue() {
  443.             public Object createValue(UIDefaults table) {
  444.                 return MacMenuUtilities.getMenuArrowIcon();
  445.             }
  446.         };
  447.  
  448.         Object checkBoxMenuItemIcon = new UIDefaults.LazyValue() {
  449.                 public Object createValue(UIDefaults table) {
  450.                 return MacMenuUtilities.getCheckBoxMenuItemIcon();
  451.             }
  452.         };
  453.  
  454.         Object menuItemCheckIcon = new UIDefaults.LazyValue() {
  455.             public Object createValue(UIDefaults table) {
  456.                 return MacMenuUtilities.getMenuItemCheckIcon();
  457.             }
  458.         };
  459.  
  460.         Object menuPressedBackground = makeAccentColor("AccentAppearance10");
  461.  
  462.         Object radioButtonIcon = new UIDefaults.LazyValue() {
  463.                 public Object createValue(UIDefaults table) {
  464.                         return MacIconFactory.getRadioButtonIcon();
  465.                 }
  466.         };
  467.         
  468.         Object checkBoxIcon = new UIDefaults.LazyValue() {
  469.                 public Object createValue(UIDefaults table) {
  470.                         return MacIconFactory.getCheckBoxIcon();
  471.                 }
  472.         };
  473.  
  474.  
  475.  
  476.         Object cellEditorBorder = new UIDefaults.LazyValue(){
  477.           public Object createValue(UIDefaults table) {
  478.             return new BorderUIResource(LineBorder.createBlackLineBorder());
  479.           };
  480.         };
  481.         
  482.         Object[] defaults = {
  483.  
  484.             "Button.border", buttonBorder,
  485.             "Button.shadow", controlDarker,
  486.             "Button.font", dialogPlain12,
  487.  
  488.                 "Panel.background", table.get("window"),
  489.  
  490.                 "Control.disabledForeground", MacUtilities.GrayscaleAppearance7,                // Gray
  491.                 "Control.disabledBackground", MacUtilities.GrayscaleAppearance2,                // LightGray
  492.                 "Control.pressedForeground", MacUtilities.GrayscaleAppearanceW,                 // White
  493.                 "Control.pressedBackground", MacUtilities.GrayscaleAppearance9,                 // DarkGray
  494.  
  495.             "ToggleButton.border", buttonToggleBorder,
  496.  
  497.             "MenuBar.border", menuBarBorder,
  498.  
  499.             "RadioButtonMenuItem.icon", checkBoxMenuItemIcon,
  500.             "CheckBoxMenuItem.icon", checkBoxMenuItemIcon,
  501.  
  502.             "Menu.pressedForeground", MacUtilities.GrayscaleAppearanceW,
  503.             "Menu.pressedBackground", menuPressedBackground,
  504.             "Menu.arrowIcon", menuArrowIcon,
  505.  
  506.             "MenuItem.pressedForeground", MacUtilities.GrayscaleAppearanceW,
  507.             "MenuItem.pressedBackground", menuPressedBackground,
  508.             "MenuItem.checkIcon", menuItemCheckIcon,
  509.             "MenuItem.arrowIcon", null,
  510.  
  511.                 "PopupMenu.border", popupMenuBorder,        
  512.  
  513.             "Label.font", dialogPlain12,
  514.             "Label.background", table.get("control"),
  515.             "Label.foreground", table.get("controlText"),
  516.             
  517.             "List.selectedCellBackground", table.get("textHighlight"), 
  518.             "List.selectedCellForeground", MacUtilities.GrayscaleAppearanceB,
  519.             "List.defaultCellBackground", MacUtilities.GrayscaleAppearance8,
  520.             "List.defaultCellForeground", MacUtilities.GrayscaleAppearanceB,
  521.             "List.selectionBackground", table.get("textHighlight"), 
  522.             "List.selectionForeground", MacUtilities.GrayscaleAppearanceB,
  523.             "List.background", MacUtilities.GrayscaleAppearance3,
  524.             "List.foreground", MacUtilities.GrayscaleAppearanceB,
  525.             "List.focusCellHighlight", MacUtilities.GrayscaleAppearanceB,
  526.             "List.font", dialogPlain12,
  527.           //  "List.cellRenderer", listCellRendererActiveValue,
  528.             
  529.  
  530.             "DesktopIcon.icon", makeImageIcon("icons/DesktopIcon.gif"),
  531.  
  532.         "SplitPane.dividerSize", new Integer(8),
  533.  
  534.                 // ProgressBar images and colors
  535.                 "ProgressBar.foreground", controlDarker,
  536.                 "ProgressBar.determLeft", makeImageIcon("icons/ProgressBarDetermLeft.gif"),
  537.                 "ProgressBar.determHead", makeImageIcon("icons/ProgressBarHead.gif"),
  538.                 "ProgressBar.determTop", makeImageIcon("icons/ProgressBarDetermTop.gif"),
  539.                 "ProgressBar.determBottom", makeImageIcon("icons/ProgressBarDetermBottom.gif"),
  540.                 "ProgressBar.outer5", MacUtilities.GrayscaleAppearance5,
  541.                 "ProgressBar.outerW", MacUtilities.GrayscaleAppearanceW,
  542.                 "ProgressBar.inner1", MacUtilities.GrayscaleAppearance1,
  543.                 "ProgressBar.inner2", MacUtilities.GrayscaleAppearance2,
  544.                 "ProgressBar.inner3", MacUtilities.GrayscaleAppearance3,
  545.                 "ProgressBar.inner4", MacUtilities.GrayscaleAppearance4,
  546.                 "ProgressBar.inner5", MacUtilities.GrayscaleAppearance5,
  547.                 "ProgressBar.inner7", MacUtilities.GrayscaleAppearance7,
  548.                 "ProgressBar.inner8", MacUtilities.GrayscaleAppearance8,
  549.                 "ProgressBar.inner10", MacUtilities.GrayscaleAppearance10,
  550.                 "ProgressBar.inner12", MacUtilities.GrayscaleAppearance12,
  551.                 "ProgressBar.edge", MacUtilities.GrayscaleAppearanceB,
  552.                 "ProgressBar.disabledEdge", MacUtilities.GrayscaleAppearance10,
  553.  
  554.                 // PushButton images
  555.                 "PushButton.up", makeImageIcon("icons/PushButtonUp.gif"),
  556.                 "PushButton.down", makeImageIcon("icons/PushButtonDown.gif"),
  557.                 "PushButton.disabled", makeImageIcon("icons/PushButtonDisabled.gif"),
  558.                 "PushButton.defaultEnabled", makeImageIcon("icons/PushButtonDefaultEnabled.gif"),
  559.                 "PushButton.defaultDisabled", makeImageIcon("icons/PushButtonDefaultDisabled.gif"),
  560.  
  561.                 //Toggle Button images
  562.                 //!!! LAB !!! Note "ToggleButtonLargeDisabledOff.gif", and "ToggleButtonSmallDisabledOff.gif"
  563.                 //are truncated to fit in the Mac filesystem.
  564.                 "ToggleButton.largeDisabledOn", makeImageIcon("icons/ToggleButtonLargeDisabledOn.gif"),
  565.                 "ToggleButton.largeDisabledOff", makeImageIcon("icons/ToggleButtonLargeDisabledOf.gif"),
  566.                 "ToggleButton.largeOn", makeImageIcon("icons/ToggleButtonLargeOn.gif"),
  567.                 "ToggleButton.largePressed", makeImageIcon("icons/ToggleButtonLargePressed.gif"),
  568.                 "ToggleButton.largeOff", makeImageIcon("icons/ToggleButtonLargeOff.gif"),
  569.                 "ToggleButton.mediumDisabledOn", makeImageIcon("icons/ToggleButtonMedDisabledOn.gif"),
  570.                 "ToggleButton.mediumDisabledOff", makeImageIcon("icons/ToggleButtonMedDisabledOff.gif"),
  571.                 "ToggleButton.mediumOn", makeImageIcon("icons/ToggleButtonMedOn.gif"),
  572.                 "ToggleButton.mediumPressed", makeImageIcon("icons/ToggleButtonMedPressed.gif"),
  573.                 "ToggleButton.mediumOff", makeImageIcon("icons/ToggleButtonMedOff.gif"),
  574.                 "ToggleButton.smallDisabledOn", makeImageIcon("icons/ToggleButtonSmallDisabledOn.gif"),
  575.                 "ToggleButton.smallDisabledOff", makeImageIcon("icons/ToggleButtonSmallDisabledOf.gif"),
  576.                 "ToggleButton.smallOn", makeImageIcon("icons/ToggleButtonSmallOn.gif"),
  577.                 "ToggleButton.smallPressed", makeImageIcon("icons/ToggleButtonSmallPressed.gif"),
  578.                 "ToggleButton.smallOff", makeImageIcon("icons/ToggleButtonSmallOff.gif"),
  579.  
  580.                 // RadioButton images, colors, &c
  581.                 "RadioButton.background", null,
  582.                 "RadioButton.icon", radioButtonIcon,
  583.                 "RadioButton.enabledOff", makeIcon("icons/RadioButtonEnabledOff.gif"),
  584.                 "RadioButton.enabledOn", makeIcon("icons/RadioButtonEnabledOn.gif"),
  585.                 "RadioButton.pressedOff", makeIcon("icons/RadioButtonPressedOff.gif"),
  586.                 "RadioButton.pressedOn", makeIcon("icons/RadioButtonPressedOn.gif"),
  587.                 "RadioButton.disabledOff", makeIcon("icons/RadioButtonDisabledOff.gif"),
  588.                 "RadioButton.disabledOn", makeIcon("icons/RadioButtonDisabledOn.gif"),
  589.  
  590.                 // CheckBox images, colors, &c
  591.                 "CheckBox.icon", checkBoxIcon,
  592.                 "CheckBox.enabledOff", makeIcon("icons/CheckBoxEnabledOff.gif"),
  593.                 "CheckBox.enabledOn", makeIcon("icons/CheckBoxEnabledOn.gif"),
  594.                 "CheckBox.pressedOff", makeIcon("icons/CheckBoxPressedOff.gif"),
  595.                 "CheckBox.pressedOn", makeIcon("icons/CheckBoxPressedOn.gif"),
  596.                 "CheckBox.disabledOff", makeIcon("icons/CheckBoxDisabledOff.gif"),
  597.                 "CheckBox.disabledOn", makeIcon("icons/CheckBoxDisabledOn.gif"),
  598.  
  599.                 // ScrollBar images, colors, &c
  600.             "ScrollBar.backgroundEnabled", MacUtilities.GrayscaleAppearance5,
  601.             "ScrollBar.backgroundDisabled", MacUtilities.GrayscaleAppearance1,
  602.             "ScrollBar.borderActive", MacUtilities.GrayscaleAppearanceB,
  603.             "ScrollBar.borderInactive", MacUtilities.GrayscaleAppearance10,
  604.  
  605.             "ScrollBar.bevelIn1", MacUtilities.GrayscaleAppearance8,
  606.             "ScrollBar.bevelIn2", MacUtilities.GrayscaleAppearance7,
  607.             "ScrollBar.bevelCorner", MacUtilities.GrayscaleAppearance5,
  608.             "ScrollBar.bevelOut2", MacUtilities.GrayscaleAppearance4,
  609.             "ScrollBar.bevelOut1", MacUtilities.GrayscaleAppearance3,
  610.  
  611.             "ScrollBar.border", null,
  612.  
  613.                 "ScrollBar.upArrowDisabled", makeIcon("icons/ScrollUpArrowDisabled.gif"),
  614.                 "ScrollBar.upArrowEnabled", makeIcon("icons/ScrollUpArrowEnabled.gif"),
  615.                 "ScrollBar.upArrowPressed", makeIcon("icons/ScrollUpArrowPressed.gif"),
  616.                 "ScrollBar.downArrowDisabled", makeIcon("icons/ScrollDownArrowDisabled.gif"),
  617.                 "ScrollBar.downArrowEnabled", makeIcon("icons/ScrollDownArrowEnabled.gif"),
  618.                 "ScrollBar.downArrowPressed", makeIcon("icons/ScrollDownArrowPressed.gif"),
  619.                 "ScrollBar.rightArrowDisabled", makeIcon("icons/ScrollRightArrowDisabled.gif"),
  620.                 "ScrollBar.rightArrowEnabled", makeIcon("icons/ScrollRightArrowEnabled.gif"),
  621.                 "ScrollBar.rightArrowPressed", makeIcon("icons/ScrollRightArrowPressed.gif"),
  622.                 "ScrollBar.leftArrowDisabled", makeIcon("icons/ScrollLeftArrowDisabled.gif"),
  623.                 "ScrollBar.leftArrowEnabled", makeIcon("icons/ScrollLeftArrowEnabled.gif"),
  624.                 "ScrollBar.leftArrowPressed", makeIcon("icons/ScrollLeftArrowPressed.gif"),
  625.  
  626.                 "ScrollBar.horizontalBoxEnabled", makeImageIcon("icons/ScrollHorizontalBoxEnabled.gif"),
  627.                 "ScrollBar.horizontalBoxPressed", makeImageIcon("icons/ScrollHorizontalBoxPressed.gif"),
  628.                 "ScrollBar.verticalBoxEnabled", makeImageIcon("icons/ScrollVerticalBoxEnabled.gif"),
  629.                 "ScrollBar.verticalBoxPressed", makeImageIcon("icons/ScrollVerticalBoxPressed.gif"),
  630.  
  631.             "ScrollPane.border", null,
  632.             "ScrollPane.viewportBorder", loweredBevelBorder,
  633.  
  634. //              "Slider.border", null,
  635.                 "Slider.background", null,
  636.  
  637.                 "Slider.tickColorEnabled", MacUtilities.GrayscaleAppearanceB,
  638.                 "Slider.tickColorDisabled", MacUtilities.GrayscaleAppearance8,
  639.                 "Slider.tickHilite", MacUtilities.GrayscaleAppearanceW,
  640.                 "Slider.tickShadow", MacUtilities.GrayscaleAppearance7,
  641.  
  642.                 "Slider.trackBorderEnabled", MacUtilities.GrayscaleAppearance12,
  643.                 "Slider.trackFillEnabled", MacUtilities.GrayscaleAppearance5,
  644.                 "Slider.trackBorderDisabled", MacUtilities.GrayscaleAppearance8,
  645.                 "Slider.trackFillDisabled", MacUtilities.GrayscaleAppearance4,
  646.                 "Slider.trackBevelIn", MacUtilities.GrayscaleAppearance5,
  647.                 "Slider.trackBevelOut", MacUtilities.GrayscaleAppearanceW,
  648.  
  649.                 "Slider.indicatorHorizontalEnabled", makeImageIcon("icons/SliderHorizEnabled.gif"),
  650.                 "Slider.indicatorHorizontalDisabled", makeImageIcon("icons/SliderHorizDisabled.gif"),
  651.                 "Slider.indicatorHorizontalPressed", makeImageIcon("icons/SliderHorizPressed.gif"),
  652.                 "Slider.indicatorHorizontalDownEnabled", makeImageIcon("icons/SliderHorizDownEnabled.gif"),
  653.                 "Slider.indicatorHorizontalDownDisabled", makeImageIcon("icons/SliderHorizDownDisabled.gif"),
  654.                 "Slider.indicatorHorizontalDownPressed", makeImageIcon("icons/SliderHorizDownPressed.gif"),
  655.                 "Slider.indicatorHorizontalUpEnabled", makeImageIcon("icons/SliderHorizUpEnabled.gif"),
  656.                 "Slider.indicatorHorizontalUpDisabled", makeImageIcon("icons/SliderHorizUpDisabled.gif"),
  657.                 "Slider.indicatorHorizontalUpPressed", makeImageIcon("icons/SliderHorizUpPressed.gif"),
  658.  
  659.                 "Slider.indicatorVerticalEnabled", makeImageIcon("icons/SliderVertEnabled.gif"),
  660.                 "Slider.indicatorVerticalDisabled", makeImageIcon("icons/SliderVertDisabled.gif"),
  661.                 "Slider.indicatorVerticalPressed", makeImageIcon("icons/SliderVertPressed.gif"),
  662.                 "Slider.indicatorVerticalLeftEnabled", makeImageIcon("icons/SliderVertLeftEnabled.gif"),
  663.                 "Slider.indicatorVerticalLeftDisabled", makeImageIcon("icons/SliderVertLeftDisabled.gif"),
  664.                 "Slider.indicatorVerticalLeftPressed", makeImageIcon("icons/SliderVertLeftPressed.gif"),
  665.                 "Slider.indicatorVerticalRightEnabled", makeImageIcon("icons/SliderVertRightEnabled.gif"),
  666.                 "Slider.indicatorVerticalRightDisabled", makeImageIcon("icons/SliderVertRightDisabled.gif"),
  667.                 "Slider.indicatorVerticalRightPressed", makeImageIcon("icons/SliderVertRightPressed.gif"),
  668.  
  669.             "Spinner.fieldBackground", table.get("textHighlight"),
  670.             "Spinner.fieldForeground", MacUtilities.GrayscaleAppearanceB,
  671.  
  672.             "SplitPane.background", table.get("control"),
  673.             "SplitPane.highlight", table.get("controlHighlight"),
  674.             "SplitPane.shadow", table.get("controlShadow"),
  675.  
  676.                 // Tabbed Pane font, colors & images
  677.                 "TabbedPane.font", dialogPlain12,
  678.                 "TabbedPane.enabledTabBackground", MacUtilities.GrayscaleAppearance3,
  679.                 "TabbedPane.enabledTabForeground", MacUtilities.GrayscaleAppearanceB,
  680.                 "TabbedPane.enabledTabHilite1", MacUtilities.GrayscaleAppearance3,
  681.                 "TabbedPane.enabledTabHilite2", MacUtilities.GrayscaleAppearance2,
  682.  
  683.                 "TabbedPane.selectedTabBackground", MacUtilities.GrayscaleAppearance1,
  684.                 "TabbedPane.selectedTabForeground", MacUtilities.GrayscaleAppearanceB,
  685.                 "TabbedPane.selectedTabHilite1", MacUtilities.GrayscaleAppearance3,
  686.                 "TabbedPane.selectedTabHilite2", MacUtilities.GrayscaleAppearanceW,
  687.  
  688.                 "TabbedPane.pressedTabBackground", MacUtilities.GrayscaleAppearance9,
  689.                 "TabbedPane.pressedTabForeground", MacUtilities.GrayscaleAppearanceW,
  690.                 "TabbedPane.pressedTabHilite1", MacUtilities.GrayscaleAppearance11,
  691.                 "TabbedPane.pressedTabHilite2", MacUtilities.GrayscaleAppearance10,
  692.  
  693.                 "TabbedPane.disabledTabBackground", MacUtilities.GrayscaleAppearance2,
  694.                 "TabbedPane.disabledTabForeground", MacUtilities.GrayscaleAppearance7,
  695.                 "TabbedPane.disabledTabHilite1", MacUtilities.GrayscaleAppearance2,
  696.                 "TabbedPane.disabledTabHilite2", MacUtilities.GrayscaleAppearance2,
  697.  
  698.                 "TabbedPane.enabledTabBorder", makeImageIcon("icons/TabbedPaneEnabledTabBorder.gif"),
  699.                 "TabbedPane.selectedTabBorder", makeImageIcon("icons/TabbedPaneSelectedTabBorder.gif"),
  700.                 "TabbedPane.pressededTabBorder", makeImageIcon("icons/TabbedPanePressedTabBorder.gif"),
  701.                 "TabbedPane.disabledTabBorder", makeImageIcon("icons/TabbedPaneDisabledTabBorder.gif"),
  702.  
  703.                 "TabbedPane.enabledPaneBackground", MacUtilities.GrayscaleAppearance1,
  704.                 "TabbedPane.enabledPaneBorder", MacUtilities.GrayscaleAppearanceB,
  705.                 "TabbedPane.enabledPaneBevelHilite1", MacUtilities.GrayscaleAppearance3,
  706.                 "TabbedPane.enabledPaneBevelHilite2", MacUtilities.GrayscaleAppearanceW,
  707.                 "TabbedPane.enabledPaneBevelShadow1", MacUtilities.GrayscaleAppearance6,
  708.                 "TabbedPane.enabledPaneBevelShadow2", MacUtilities.GrayscaleAppearance4,
  709.                 "TabbedPane.enabledPaneBevelAccent1", MacUtilities.GrayscaleAppearance2,
  710.                 "TabbedPane.enabledPaneBevelAccent2", MacUtilities.GrayscaleAppearance1,
  711.                 "TabbedPane.enabledPaneBevelAccent3", MacUtilities.GrayscaleAppearance7,
  712.  
  713.                 "TabbedPane.disabledPaneBackground", MacUtilities.GrayscaleAppearance2,
  714.                 "TabbedPane.disabledPaneBorder", MacUtilities.GrayscaleAppearance10,
  715.                 "TabbedPane.disabledPaneBevelHilite1", MacUtilities.GrayscaleAppearance2,
  716.                 "TabbedPane.disabledPaneBevelHilite2", MacUtilities.GrayscaleAppearance2,
  717.                 "TabbedPane.disabledPaneBevelShadow1", MacUtilities.GrayscaleAppearance2,
  718.                 "TabbedPane.disabledPaneBevelShadow2", MacUtilities.GrayscaleAppearance2,
  719.                 "TabbedPane.disabledPaneBevelAccent1", MacUtilities.GrayscaleAppearance2,
  720.                 "TabbedPane.disabledPaneBevelAccent2", MacUtilities.GrayscaleAppearance2,
  721.  
  722.             "Table.font", dialogPlain12,
  723.             "Table.border", null, 
  724.             "Table.foreground", table.get("controlText"),                  // cell text color
  725.             "Table.background", MacUtilities.GrayscaleAppearance1,         // cell background color
  726.             "Table.selectionForeground", MacUtilities.GrayscaleAppearanceB, 
  727.             "Table.selectionBackground", MacUtilities.GrayscaleAppearance2,
  728.             "Table.gridColor", MacUtilities.GrayscaleAppearanceW,          // grid line color
  729.             "Table.cellSpacing", new DimensionUIResource(0, 0),            // inter-cell spacing
  730.             "Table.cellEditorBorder", cellEditorBorder,                    // for currently edited cell
  731.  
  732.             "TableHeader.font", dialogPlain12, 
  733.             "TableHeader.foreground", table.get("controlText"),            // header text color
  734.             "TableHeader.background", MacUtilities.GrayscaleAppearance3,   // header background
  735.             "TableHeader.selectionForeground", MacUtilities.GrayscaleAppearanceB,
  736.             "TableHeader.selectionBackground", table.get("textHighlight"),
  737.             "TableHeader.gridColor", MacUtilities.GrayscaleAppearanceW,    // color of lines between column headings        
  738.                 
  739.                 "Tree.showsRootHandles", new Boolean(true),
  740.                 "Tree.font", sansSerifPlain9,
  741.             "Tree.background", MacUtilities.GrayscaleAppearance2,
  742.             "Tree.textSelectionColor", table.get("textHighlight"),
  743.             "Tree.textNonSelectionColor", table.get("textText"),
  744.             "Tree.openIcon", makeIcon("icons/TreeOpen.gif"),
  745.             "Tree.closedIcon", makeIcon("icons/TreeClosed.gif"),
  746.             "Tree.selectedIcon", makeIcon("icons/TreeSelected.gif"),
  747.             "Tree.selectedLeafIcon", makeIcon("icons/TreeLeafSelected.gif"),
  748.             "Tree.leafIcon", makeIcon("icons/TreeLeaf.gif"),
  749.             "Tree.expandedIcon", makeIcon("icons/TreeExpanded.gif"),
  750.             "Tree.collapsedIcon", makeIcon("icons/TreeCollapsed.gif"),
  751.             "Tree.collapsedPressedIcon", makeIcon("icons/TreeCollapsedPressed.gif"),
  752.             "Tree.expandedPressedIcon", makeIcon("icons/TreeExpandedPressed.gif"),
  753.             "Tree.intermediateIcon", makeIcon("icons/TreeIntermediate.gif"),
  754.  
  755. //        "ComboBox.renderer", comboBoxRendererActiveValue,
  756.         "ComboBox.editor",   comboBoxEditorActiveValue,
  757.                 "ComboBox.background", null, //table.get("MenuItem.background"),
  758.                 "ComboBox.foreground", table.get("MenuItem.foreground"),
  759.                 "ComboBox.selectedBackground", table.get("MenuItem.background"),
  760.                 "ComboBox.selectedForeground", table.get("MenuItem.foreground"),
  761.                 "ComboBox.font", table.get("MenuItem.font"),
  762.                 
  763.                 "ComboBoxArrowBorder.enabled", makeImageIcon("icons/ComboBoxArrowEnabled.gif"),
  764.                 "ComboBoxArrowBorder.pressed", makeImageIcon("icons/ComboBoxArrowPressed.gif"),
  765.                 "ComboBoxArrowBorder.disabled", makeImageIcon("icons/ComboBoxArrowDisabled.gif"),
  766.                 "ComboBoxEditArrowBorder.enabled", makeImageIcon("icons/ComboBoxEditArrowEnabled.gif"),
  767.                 "ComboBoxEditArrowBorder.pressed", makeImageIcon("icons/ComboBoxEditArrowPressed.gif"),
  768.                 "ComboBoxEditArrowBorder.disabled", makeImageIcon("icons/ComboBoxEditArrowDisabled.gif"),
  769.                 "ComboBoxBorder.enabled", makeImageIcon("icons/ComboBoxEnabled.gif"),
  770.                 "ComboBoxBorder.pressed", makeImageIcon("icons/ComboBoxPressed.gif"),
  771.                 "ComboBoxBorder.disabled", makeImageIcon("icons/ComboBoxDisabled.gif"),
  772.  
  773.             "TextField.caretForeground", MacUtilities.GrayscaleAppearanceB,
  774.             "TextField.caretBlinkRate", new Integer(500),
  775.             "TextField.inactiveForeground", table.get("textInactiveText"),
  776.             "TextField.selectionBackground", table.get("textHighlight"),
  777.             "TextField.selectionForeground", table.get("textHighlightText"),
  778.             "TextField.background", MacUtilities.GrayscaleAppearanceW,
  779.             "TextField.foreground", table.get("textText"),
  780.             "TextField.font", sansSerifPlain12,
  781.             "TextField.border", fieldTextBorder,
  782.             
  783.             "PasswordField.caretForeground", MacUtilities.GrayscaleAppearanceB,
  784.             "PasswordField.caretBlinkRate", new Integer(500),
  785.             "PasswordField.inactiveForeground", table.get("textInactiveText"),
  786.             "PasswordField.selectionBackground", table.get("textHighlight"),
  787.             "PasswordField.selectionForeground", table.get("textHighlightText"),
  788.             "PasswordField.background", MacUtilities.GrayscaleAppearanceW,
  789.             "PasswordField.foreground", table.get("textText"),
  790.             "PasswordField.font", sansSerifPlain12,
  791.             "PasswordField.border", fieldTextBorder,
  792.             
  793.             "TextArea.caretForeground", MacUtilities.GrayscaleAppearanceB,
  794.             "TextArea.caretBlinkRate", new Integer(500),
  795.             "TextArea.inactiveForeground", table.get("textInactiveText"),
  796.             "TextArea.selectionBackground", table.get("textHighlight"),
  797.             "TextArea.selectionForeground", table.get("textHighlightText"),
  798.             "TextArea.background", MacUtilities.GrayscaleAppearanceW,
  799.             "TextArea.foreground", table.get("textText"),
  800.             "TextArea.font", sansSerifPlain12,
  801.             "TextArea.border", multilineTextBorder,
  802.             
  803.             "TextPane.caretForeground", MacUtilities.GrayscaleAppearanceB,
  804.             "TextPane.caretBlinkRate", new Integer(500),
  805.             "TextPane.inactiveForeground", table.get("textInactiveText"),
  806.             "TextPane.selectionBackground", table.get("textHighlight"),
  807.             "TextPane.selectionForeground", table.get("textHighlightText"),
  808.             "TextPane.background", MacUtilities.GrayscaleAppearanceW,
  809.             "TextPane.foreground", table.get("textText"),
  810.             "TextPane.font", serifPlain12,
  811.             "TextPane.border", multilineTextBorder,
  812.             
  813.             "EditorPane.caretForeground", MacUtilities.GrayscaleAppearanceB,
  814.             "EditorPane.caretBlinkRate", new Integer(500),
  815.             "EditorPane.inactiveForeground", table.get("textInactiveText"),
  816.             "EditorPane.selectionBackground", table.get("textHighlight"),
  817.             "EditorPane.selectionForeground", table.get("textHighlightText"),
  818.             "EditorPane.background", MacUtilities.GrayscaleAppearanceW,
  819.             "EditorPane.foreground", table.get("textText"),
  820.             "EditorPane.font", serifPlain12,
  821.             "EditorPane.border", null,
  822.  
  823.                 "ToolTip.font", sansSerifPlain10,
  824.             "ToolTip.border", null,
  825.             "ToolTip.background", table.get("info"),
  826.             "ToolTip.foreground", table.get("infoText"),
  827.  
  828.             "ToolBar.border", menuBarBorder,
  829.             "ToolBar.background", table.get("control"),
  830.             "ToolBar.foreground", table.get("controlText"),
  831.             "ToolBar.font", dialogPlain12,
  832.             "ToolBar.dockingColor", table.get("control"),
  833.             "ToolBar.floatingColor", table.get("control"),
  834.             "ToolBar.dockingBorderColor", AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance8), 
  835.             "ToolBar.floatingBorderColor", table.get("control"),
  836.             
  837.             "OptionPane.errorIcon", makeIcon("icons/Error.gif"),
  838.             "OptionPane.informationIcon", makeIcon("icons/Inform.gif"),
  839.             "OptionPane.warningIcon", makeIcon("icons/Warn.gif"),
  840.             "OptionPane.questionIcon", makeIcon("icons/Inform.gif"),
  841.  
  842.             "FileChooser.newFolder", LookAndFeel.makeIcon(getClass(), "icons/NewFolder.gif"),
  843.             "FileChooser.upFolder", LookAndFeel.makeIcon(getClass(), "icons/UpFolder.gif"),
  844.             "FileChooser.homeFolder", LookAndFeel.makeIcon(getClass(), "icons/Folder.gif"),
  845.             "FileChooser.detailsView", LookAndFeel.makeIcon(getClass(), "icons/DetailsView.gif"),
  846.             "FileChooser.listView", LookAndFeel.makeIcon(getClass(), "icons/ListView.gif"),
  847.  
  848.             "DirectoryPane.directoryIcon", LookAndFeel.makeIcon(getClass(), "icons/Folder.gif"),
  849.             "DirectoryPane.fileIcon", LookAndFeel.makeIcon(getClass(), "icons/File.gif"),
  850.             "DirectoryPane.computerIcon", LookAndFeel.makeIcon(getClass(), "icons/Computer.gif"),
  851.             "DirectoryPane.hardDriveIcon", LookAndFeel.makeIcon(getClass(), "icons/HardDrive.gif"),
  852.             "DirectoryPane.floppyDriveIcon", LookAndFeel.makeIcon(getClass(), "icons/FloppyDrive.gif"),
  853.  
  854.                 // Window images and colors
  855.                 "Window.closeEnabled", makeIcon("icons/WindowCloseEnabled.gif"),
  856.                 "Window.closePressed", makeIcon("icons/WindowClosePressed.gif"),
  857.                 "Window.sizeEnabled", makeIcon("icons/WindowSizeEnabled.gif"),
  858.                 "Window.zoomEnabled", makeIcon("icons/WindowZoomEnabled.gif"),
  859.                 "Window.zoomPressed", makeIcon("icons/WindowZoomPressed.gif"),
  860.                 "Window.minimizeEnabled", makeIcon("icons/WindowMinimizeEnabled.gif"),
  861.                 "Window.minimizePressed", makeIcon("icons/WindowMinimizePressed.gif"),
  862.  
  863.         };
  864.  
  865.         table.putDefaults(defaults);
  866.     }
  867.  
  868.  
  869.         private static String defaultAppearance = null;
  870.         
  871.         public static void setCurrentAppearance(String appearanceName) {
  872.                 defaultAppearance = appearanceName;
  873.         }
  874.         
  875.         private static String getCurrentAppearance() {
  876.                 if (defaultAppearance != null)
  877.                         return defaultAppearance;
  878.                 return MacUtilities.GetAppearanceName();
  879.         }
  880. }
  881.  
  882.